#include "BossObj.h"
#include "GameRoom.h"
#include "ScriptEngine.h"
#include "Environment.h"

BossObj::BossObj( hgeAnimation *Boss,float x,float y,float time,int hp,std::string script,hgeSprite *Bullet1,hgeSprite *Bullet2,hgeSprite *Bullet3)
:EnermyObj(Boss,NULL,x,y,time,hp,script,0)
{
	m_bulletSprites.push_back(Bullet1);
	m_bulletSprites.push_back(Bullet2);
	m_bulletSprites.push_back(Bullet3);
}

BossObj::~BossObj()
{

}

void BossObj::fire( float par, int SpriteType, int ScriptType )
{
	m_bullMan.addBullet(new BulletInfo(m_bulletSprites[SpriteType],m_x,m_y,0,0,0,par,ScriptType));
	m_lastfiretime = GameRoom::getLiveTime();
}

void BossObj::Update()
{
	m_enermy->Update(Environment::GetDelta());
	m_clear = ScriptEngine::Compute(m_conScript.c_str(),m_time,GameRoom::getLiveTime(),this);
	m_bullMan.Update();
}

int BossObj::getHP()
{
	return m_hp;
}